package cn.wolfcode.p2p.base.domain;

import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * Created by wolfcode on 2018/7/23.
 */
@Setter
@Getter
public class IpLog extends BaseDomain {
	public static final int STATE_FAILED = 0;
	public static final int STATE_SUCCESS = 1;
	private String username;// 登陆用户
	private Date loginTime;// 登陆时间
	private String ip;// 来源IP
	private int state;// 登陆状态

	private int userType;// 当前登录的用户类型

	public String getStateDisplay() {
		return this.state == STATE_SUCCESS ? "登录成功" : "登录失败";
	}

	public String getUserTypeDisplay() {
		return this.userType == LoginInfo.TYPE_MANAGER ? "管理员" : "普通用户";
	}
}
